<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <!--layui样式-->
  <link href="editor/assets/drag/layui-v2.4.5/layui/css/layui.css" rel="stylesheet">
  <link href="editor/assets/drag/layui-v2.4.5/layui-ext.css" rel="stylesheet">
  <script type="text/javascript" src="editor/assets/drag/layui-v2.4.5/layui/layui.all.js"></script>
  <script type="text/javascript" src="editor/assets/drag/js/lib/vue/axios.js"></script>
  <script type="text/javascript" src="editor/assets/drag/js/user/ui/common/common-util.js"></script>
  <title>登录</title>
</head>
<body>
<div class="layui-container" style="width: 40%;margin-top:10%">
  <form class="layui-form" style="padding-right:20px;padding-top:20px;" id="loginForm">
    <div class="layui-form-item">
      <label class="layui-form-label">用户名</label>
      <div class="layui-input-block">
        <input type="text" style="width:200px" name="username" required value="admin"  lay-verify="required" placeholder="请输入用户名" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <label class="layui-form-label">密码框</label>
      <div class="layui-input-inline">
        <input type="password" style="width:200px" name="password" required value="123456" lay-verify="required" placeholder="请输入密码" autocomplete="off" class="layui-input">
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-input-block">
        <a class="layui-btn" id="login">立即登录</a>
      </div>
    </div>
  </form>
</div>


<script>
     var $ = layui.jquery;
     $("#login").click(function(){
         var userName = $("#loginForm").find("[name='username']").val();
         var password = $("#loginForm").find("[name='password']").val();
          CommonUtil.axiosWithServerName('post',
                  '/magical_lowcode/server/web/login',
                  {userName:userName,password:password,date:new Date().getTime()},
                  function(res){
                      console.log(res)
                      window.location.href="editor/index-element.html?projectUuid=2c9fe31d79d0fba10179d0fea5be0000";
                  }
          )
     })

   </script>
</body>
</html>
